import request from '@/utils/request'
import Vue from 'vue'
export function searchAnalyze(data) { //获取搜索分词数据
	return request({
		method: 'post',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/story/analyze',
		data,
	})
}
export function select(data) { //全文搜索—各种不同参数
	return request({
		method: 'post',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/story/es/select',
		data,
	})
}
export function selectTheme(data) { //全文搜索—主题搜索
	return request({
		method: 'post',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/story/es/select/theme',
		data,
	})
}

export function selectDetails(data) { //搜索详情
	return request({
		method: 'get',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/story/get/' + data,

	})
}

export function viewDetails(data) { //搜索详情
	return request({
		method: 'get',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/story/view/' + data,

	})
}

export function selectDetailStory(data) { //相关推荐-ID
	return request({
		method: 'get',
		headers: {
			apiType: 2
		},
		url: '/hn-search/v1/story/middle/data/recommend/story/' + data,

	})
}

export function queryRecommendResource(data) { //相关推荐-用户
	return request({
		method: 'get',
		headers: {
			apiType: 2
		},
		url: '/hn-search/v1/story/middle/data/recommend/story/user',
	})
}

export function historySearchList(limit) { //搜索历史
	return request({
		method: 'get',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/history/search/list?limit=' + limit,

	})
}

export function searchHotword(data) { //搜索热词
	return request({
		method: 'get',
		headers: {
			apiType: 2,
			noNeedLogin: true
		},
		url: 'hn-search/v1/history/search/page/list',
		data
	})
}

export function faceSearch(data) { //人脸识图
	return request({
		method: 'post',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/face/search/find',
		data
	})
}

export function selectDownload(id) { //增加下载次数
	return request({
		method: 'get',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/story/download/' + id,

	})
}

export function selectCollect(data) { //收藏
	return request({
		method: 'post',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/story/collect',
		data: data

	})
}

export function selectunCollect(data) { //取消收藏
	return request({
		method: 'post',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/story/unCollect',
		data: data
	})
}

export function fileParserAll(data) { //文件解析器查询
	return request({
		method: 'get',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/fileParser/all',
	})
}

export function fileParserUninstallId(id) { //文件解析器删除
	return request({
		method: 'get',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/fileParser/uninstall/' + id,
	})
}

export function queryCollect(data) { //获取收藏列表
	return request({
		method: 'post',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/story/get/myCollect',
		data: data
	})
}

export function tbResourceCollectQuery(data) { //获取收藏列表
	return request({
		method: 'get',
		url: '/tbResourceCollect/queryPageList',
		params: data
	})
}

export function hnSearchSensitiveWordAudit(id) { // 查询敏感词位置 
	return request({
		method: 'get',
		headers: {
			apiType: 2
		},
		url: 'hn-search/v1/sensitive/word/audit/' + id,
	})
}

export function fileInfoList(list) { //批量获取资源信息
	return request({
		method: 'post',
		url: '/tbSysZy/queryInfos',
		data: list
	})
}

export function facelib(data) {
	return request({
		method: 'get',
		headers: {
			apiType: 3
		},
		url: 'video-server/v1/face/db',
		params: data
	})
}